package itheima.controller;

import itheima.pojo.Dept;
import itheima.pojo.Result;
import itheima.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptController {
@Autowired
    private DeptService deptService;
@GetMapping("/depts")
    public Result list() {
        System.out.println("查询全部部门信息");
        List<Dept> list=deptService.findAll();
        return Result.success(list);
    }
}
